<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.jsdelivr.net/npm/vue@2.7.14/dist/vue.js"></script>
</head>
<!-- 给表单元素使用，双向数据绑定-->
<!-- 数据变，视图变 -->
<!-- 视图变，数据变 -->
<!-- 可以快速获取或设置内容!!! -->
<body>
    <div id="app">
    账户：<input type="text" v-model="username"><br><br>
    密码：<input type="password" v-model="password"><br><br>
    <button @click="login()" >登录</button>
    <button @click="reset()">重置</button>
    </div>
</body>
<script>
   const app=new Vue({
    el:'#app',
    data:{
        username:"",
        password:""
    },
    methods: {
        login(){
            console.log(this.password)
            console.log(this.username)
        },
        reset(){
            this.password=""
            this.username=""
        }
    }
   })
</script>
</html>